<template>
  <div id="app">
    <NavigationBar  />
    <router-view class="router" />
  </div>
</template>
<script>
// @ is an alias to /src
import NavigationBar from '@/components/NavigationBar/index.vue'


//防止样式反复计算从而死循环
const debounce = (fn, delay) => {
  let timer = null;

  return function () {
    let context = this;

    let args = arguments;

    clearTimeout(timer);

    timer = setTimeout(function () {
      fn.apply(context, args);
    }, delay);
  };
};

// 解决ERROR ResizeObserver loop completed with undelivered notifications.
const _ResizeObserver = window.ResizeObserver;

window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
  constructor(callback) {
    callback = debounce(callback, 16);
    super(callback);
  }
};

export default {
  name: 'HomeView',
  data() {
    return {
      id: '0',
    }
  },
  components: {
    NavigationBar
  }
}
</script>


<style lang="scss">

</style>
